package test4_15.demo01;

class test6 {
    public static void main(String[] args) {

        System.out.println("开始");

        Six one1 = new Six();
        Six one2 = new Six();

        new Thread(() -> one1.getOne()).start();
        new Thread(() -> one2.getTwo()).start();


    }
}


public class Six {

    public static synchronized void getOne() {

        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        System.out.println("=====1=====");
    }

    public static synchronized void getTwo() {
        System.out.println("=====2=====");
    }

}
